/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.ProjetoFinal.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author DCBorges
 */
@Entity
@Table(name = "sdctb017_grpo_rjco")
public class GrupoRejeicao implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "NU_SQNCL_RJCO")
    private Integer nuSqnclRjco;
    @JoinColumn(name = "NU_SQNCL_INSCRICAO", referencedColumnName = "NU_SQNCL_INSCRICAO")
    @ManyToOne
    private Inscricao nuSqnclInscricao;
    @JoinColumn(name = "NU_SNQCL_GRPO_FMLR", referencedColumnName = "NU_SNQCL_GRPO_FMLR")
    @ManyToOne
    private GrupoFamiliar nuSnqclGrpoFmlr;
    @JoinColumn(name = "CO_MOTIVO_REJEICAO", referencedColumnName = "CO_MOTIVO_REJEICAO")
    @ManyToOne(optional = false)
    private MotivoRejeicao coMotivoRejeicao;

    public GrupoRejeicao() {
    }

    public GrupoRejeicao(Integer nuSqnclRjco) {
        this.nuSqnclRjco = nuSqnclRjco;
    }

    public Integer getNuSqnclRjco() {
        return nuSqnclRjco;
    }

    public void setNuSqnclRjco(Integer nuSqnclRjco) {
        this.nuSqnclRjco = nuSqnclRjco;
    }

    public Inscricao getNuSqnclInscricao() {
        return nuSqnclInscricao;
    }

    public void setNuSqnclInscricao(Inscricao nuSqnclInscricao) {
        this.nuSqnclInscricao = nuSqnclInscricao;
    }

    public GrupoFamiliar getNuSnqclGrpoFmlr() {
        return nuSnqclGrpoFmlr;
    }

    public void setNuSnqclGrpoFmlr(GrupoFamiliar nuSnqclGrpoFmlr) {
        this.nuSnqclGrpoFmlr = nuSnqclGrpoFmlr;
    }

    public MotivoRejeicao getCoMotivoRejeicao() {
        return coMotivoRejeicao;
    }

    public void setCoMotivoRejeicao(MotivoRejeicao coMotivoRejeicao) {
        this.coMotivoRejeicao = coMotivoRejeicao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nuSqnclRjco != null ? nuSqnclRjco.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GrupoRejeicao)) {
            return false;
        }
        GrupoRejeicao other = (GrupoRejeicao) object;
        if ((this.nuSqnclRjco == null && other.nuSqnclRjco != null) || (this.nuSqnclRjco != null && !this.nuSqnclRjco.equals(other.nuSqnclRjco))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.ProjetoFinal.domain.GrupoRejeicao[ nuSqnclRjco=" + nuSqnclRjco + " ]";
    }
}
